package com.yunhe.java.pro13map;

import java.util.*;

/**
 * Created by Administrator on 2017/8/7 0007.
 */
public class BanjiMember {
    public static void main(String[] args) {
        List<UiClass> list=new ArrayList<>();
        UiClass stu1=new UiClass("eva",23,20);
        UiClass stu2=new UiClass("Linda",25,28);
        UiClass stu3=new UiClass("John",24,19);
        UiClass stu4=new UiClass("Jack",27,15);
        list.add(stu1);
        list.add(stu2);
        list.add(stu4);
        list.add(stu3);
        Collections.sort(list, new Comparator<UiClass>() {
            @Override
            public int compare(UiClass o1, UiClass o2) {
                int i=0;
                if(o1.getNo()>o2.getNo()) {
                    i = 1;
                }
                if(o1.getNo()<o2.getNo()){
                    i=-1;
                }
                return i;
            }
        });
        Iterator<UiClass> iterator= list.iterator();
        while(iterator.hasNext()){
            UiClass stu=iterator.next();
            System.out.println(stu.getNo());
        }


        Set set=new TreeSet();
        JavaClass stuj1=new JavaClass("小王",23,16);
        JavaClass stuj2=new JavaClass("小李",21,18);
        JavaClass stuj3=new JavaClass("小红",28,21);
        JavaClass stuj4=new JavaClass("小郭",22,25);
        set.add(stuj1);
        set.add(stuj2);
        set.add(stuj3);
        set.add(stuj4);


        Map<String,Object> map=new HashMap();
        map.put("Java001",set);
        map.put("Ui002",list);

       System.out.println("请输入班级名称：");
       Scanner sc=new Scanner(System.in);
       String s=sc.next();
       switch (s){
           case "Java001":
               for(Map.Entry<String,Object>entry:map.entrySet()){
                   map.get("Java001");
               }
           case "Ui002":

       }

//        System.out.println("遍历所有学员：");
//        for(Map.Entry<String,Map<String,Student>> entry : clazzs.entrySet()) {
//            for(Map.Entry<String,Student> entryi : entry.getValue().entrySet()){
//                System.out.println(entryi.getKey() + " : " + entryi.getValue().getName());
//            }
//        }
int b;
    }
}
/*1.定义集合(ArrayList)存放UI班级学员(姓名、年龄、学号,并按照学号正序)
        2.定义集合(TreeSet)存放Java班级学员(姓名、年龄、学号,并按照学号正序)
        3.从控制台输入班级名称，展示出该班级的所有学员，若无该班级，则提示“没有该班级”*/

